import mysql2 from'mysql2/promise';
import jsyaml from 'js-yaml';
import fs from 'fs';

const yaml = fs.readFileSync('./db.config.yaml', 'utf8');
const dbConfig = jsyaml.load(yaml);
const sql = await mysql2.createConnection({
  ...dbConfig.db
});
export default sql;